{include 
	file="file:$theme_global/admin/_header.tpl"
	current="modules"
}
<div class="box">
<h1>Manage <span class="white">Modules</span></h1>
{include file="file:$theme_global/admin/_messages.tpl"}

{if count($available_modules) gt 0}
<h2>Available Modules</h2>
{foreach from=$available_modules item=module key=index}

	<div class="border-block">
	<h3>{$module.general.name}</h3>
	<dl>
		<dt>Version</dt>
			<dd>{$module.general.version}</dd>
		<dt>Author</dt>
			<dd>{$module.general.author}</dd>			
		<dt>URL</dt>
			<dd><a href="{$module.general.url}">{$module.general.url}</a></dd>
	</dl>
	<p>{$module.general.description}</p>	
	<p><a class="admin-button module-install" href="/module/index/id/{$module.id}/perform/install">Install</a><br class="clear"/></p>
	</div>	
	
{/foreach}
{/if}

{if $total_enabled gt 0}
<h2>Active Modules</h2>
{foreach from=$modules item=module key=index}
{if $module.is_enabled eq 1}
	<div class="border-block">
	<h3>{$module.general.name}</h3>
	<dl>
		<dt>Version</dt>
			<dd>{$module.general.version}</dd>
		<dt>Author</dt>
			<dd>{$module.general.author}</dd>			
		<dt>URL</dt>
			<dd><a href="{$module.general.url}">{$module.general.url}</a></dd>
	</dl>
	<p>{$module.general.description}</p>
	<p>
	<a class="admin-button module-disable" href="/module/index/id/{$module.id}/perform/disable">Disable</a>
	<a class="admin-button module-uninstall" href="/module/index/id/{$module.id}/perform/uninstall">Uninstall</a>
	</p>
	<br class="clear" />
	</div>	
{/if}	
{/foreach}
{/if}

{if $total_disabled gt 0}
<h2>Inactive Modules</h2>
{foreach from=$modules item=module key=index}
{if $module.is_enabled eq 0}
	<div class="border-block">
	<h3>{$module.general.name}</h3>
	<dl>
		<dt>Version</dt>
			<dd>{$module.general.version}</dd>
		<dt>Author</dt>
			<dd>{$module.general.author}</dd>			
		<dt>URL</dt>
			<dd><a href="{$module.general.url}">{$module.general.url}</a></dd>
	</dl>
	<p>{$module.general.description}</p>
	
	<p>
	<a class="admin-button module-uninstall" href="/module/index/id/{$module.id}/perform/uninstall">Uninstall</a>
	<a class="admin-button module-enable" href="/module/index/id/{$module.id}/perform/enable">Enable</a>
	</p>
	<br class="clear" />
	</div>
{/if}	
{/foreach}
{else}
{/if}
</div>

{include file="file:$theme_global/admin/_footer.tpl"}